package com.cipe.cmrs.controllers.reports;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.cipe.cmrs.model.Cipeproject;
import com.cipe.cmrs.service.CipeprojectstatusService;
import com.cipe.cmrs.service.DonorService;
import com.cipe.cmrs.service.DonorawardService;
import com.cipe.cmrs.service.DonorawardstatusService;
import com.cipe.cmrs.service.RegionService;

@Controller
@RequestMapping("/secure/showdonorAwardForm.do")
public class DonorAwardReportController {
	    @Autowired
		private DonorawardService donorawardService;		
		@Autowired
		private DonorawardstatusService	donorawardstatusService;
		@Autowired
		private DonorService donorService;
		protected static final String COMMAND_NAME = "donorAward";
		private static final String FORM_VIEW = "reportForms/donorAwardReportForm";
		
		@RequestMapping(method = RequestMethod.GET)
	    protected ModelAndView getFormView(@ModelAttribute(COMMAND_NAME) Cipeproject command, HttpServletRequest request) {
			   ModelAndView model=new ModelAndView(FORM_VIEW);			  		
			   model.addObject("donorawardList", donorawardService.getActiveDonoraward());
			   model.addObject("donorList", donorService.getAllDonors());
			   model.addObject("donorawardstatusList", donorawardstatusService.findAll());
			   return model.addAllObjects(getReferenceData(command, request));
	    }
		
		protected Map<String, Object> getReferenceData(Cipeproject command, HttpServletRequest request) {
			Map<String, Object> map = new HashMap<String, Object>();
			return new HashMap<String, Object>();
	    }


}
